package com.mjh.zhujianju.controller.base;

import com.livew.framework.base.controller.BaseController;
import com.livew.framework.base.service.BaseService;
import com.livew.framework.page.PagedResult;
import com.livew.framework.pojo.AjaxResult;
import com.mjh.zhujianju.model.base.PraiseEO;
import com.mjh.zhujianju.service.base.PraiseService;
import com.mjh.zhujianju.vo.base.PraiseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("praise")
public class PraiseController extends BaseController<PraiseEO> {

    @Autowired
    private PraiseService praiseService;

    @Override
    protected BaseService<PraiseEO> getService() {
        return praiseService;
    }

    @RequestMapping(value = "getPage", method = RequestMethod.POST)
    @ResponseBody
    public AjaxResult getPage(PraiseVO praiseVO) {
        PagedResult<PraiseVO> list = praiseService.getPageList(praiseVO);
        return AjaxResult.getResult(list);
    }
}
